function y = gmmcommittee_classify(Xall, gmmcommittee)
    num_classes = size(gmmcommittee.classifier{1}.model, 1);
    num_points = size(Xall{1}, 1);
    y = zeros(num_points, 1);

    label = gmmcommittee.classifier{1}.label;
    y = y + double(label(1));
    best_logp = gmmcommittee_logpdf(Xall, gmmcommittee, 1);

    for j = 2 : num_classes
        fprintf('Calculating probabilities for class %d\n', label(j));
        cur_logp = gmmcommittee_logpdf(Xall, gmmcommittee, j);
        
        for i = 1 : num_points
            if (cur_logp(i) > best_logp(i))
                y(i) = label(j);
                best_logp(i) = cur_logp(i);
            end
        end
    end
end

